#ifndef FUNDDATA_H
#define FUNDDATA_H

#include <QObject>

#include "funddbspider.h"
#include "tiantianspider.h"

class FundData : public QObject
{
    Q_OBJECT
public:
    explicit FundData(QObject *parent = nullptr);
    ~FundData();

    void askSingle(QString code);
    void askValuations(QString code);

    funData_t getSingle();
    QList<valuationData_t> getValuations();

private:
    TiantianSpider *singleSpider;
    FundDBSpider *valuationsSpider;
    funData_t singleData;
//    QList<valuationData_t> valuationsData;
    void clearSingleData();

signals:
    void singleFinished(QString, bool);
    void valuationsFinished(QString , bool);

private slots:
    void gottenSingle(bool rslt);
    void gottenValuations(bool rslt);
};

#endif // FUNDDATA_H
